# Group Stripe Authorization

**Event ADMIN**

To update or get any attribute of this data layer, you will need event admin access.

| Parameter | Type | Required |
|:----------|------|----------|
| `stripe_auth_code`  | string | **yes** |
| `stripe_publishable_key`  | string | **no** |



## Stripe Authorization Collection [/v1/stripe-authorizations]
Requires Co-Organizer Access

### Create Stripe Authorization [POST]

+ Request (application/vnd.api+json)

    + Headers

            Authorization: JWT <Auth Key>

    + Body

            {
              "data": {
                "attributes": {
                  "stripe-auth-code": "example"
                },
                "type": "stripe-authorization",
                "relationships": {
                  "event": {
                    "data": {
                      "id": "1",
                      "type": "event"
                    }
                  }
                }
              }
            }

+ Response 201 (application/vnd.api+json)

        {
          "data": {
            "relationships": {
              "event": {
                "links": {
                  "self": "/v1/stripe-authorizations/1/relationships/event",
                  "related": "/v1/events/1"
                }
              }
            },
            "attributes": {
              "stripe-publishable-key": "example"
            },
            "type": "stripe-authorization",
            "id": "1",
            "links": {
              "self": "/v1/stripe-authorizations/1"
            }
          },
          "jsonapi": {
            "version": "1.0"
          },
          "links": {
            "self": "/v1/stripe-authorizations/1"
          }
        }


## Stripe Authorization Details [/v1/stripe-authorizations/{id}]
Requires Event Co-Organizer Access
+ Parameters
    + id: 1 (integer) - ID of the stripe-authorization

### Get Stripe Authorization[GET]

+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)

        {
          "data": {
            "relationships": {
              "event": {
                "links": {
                  "self": "/v1/stripe-authorizations/1/relationships/event",
                  "related": "/v1/events/1"
                }
              }
            },
            "attributes": {
              "stripe-publishable-key": "example"
            },
            "type": "stripe-authorization",
            "id": "1",
            "links": {
              "self": "/v1/stripe-authorizations/1"
            }
          },
          "jsonapi": {
            "version": "1.0"
          },
          "links": {
            "self": "/v1/stripe-authorizations/1"
          }
        }


### Update Stripe Authorization[PATCH]

+ Request (application/vnd.api+json)

    + Headers

            Authorization: JWT <Auth Key>

    + Body

            {
              "data": {
                "attributes": {
                  "stripe-auth-code": "example"
                },
                "type": "stripe-authorization",
                "id": "1"
              }
            }

+ Response 200 (application/vnd.api+json)

        {
          "data": {
            "relationships": {
              "event": {
                "links": {
                  "self": "/v1/stripe-authorizations/1/relationships/event",
                  "related": "/v1/events/1"
                }
              }
            },
            "attributes": {
              "stripe-publishable-key": "example"
            },
            "type": "stripe-authorization",
            "id": "1",
            "links": {
              "self": "/v1/stripe-authorizations/1"
            }
          },
          "jsonapi": {
            "version": "1.0"
          },
          "links": {
            "self": "/v1/stripe-authorizations/1"
          }
        }

### Delete Stripe Authorization[DELETE]

+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)

        {
          "meta": {
            "message": "Object successfully deleted"
          },
          "jsonapi": {
            "version": "1.0"
          }
        }


## Stripe Authorization for an Event [/v1/events/{event_identifier}/stripe-authorization]
Requires event admin access
+ Parameters
    + event_identifier: 1 (string) - identifier or event id of the event. (b8324ae2 is an example of identifier)

### Get Stripe Authorization Details of an Event [GET]

+ Request

    + Headers

            Accept: application/vnd.api+json

            Authorization: JWT <Auth Key>

+ Response 200 (application/vnd.api+json)

        {
            "data": {
                "relationships": {
                    "event": {
                        "links": {
                            "self": "/v1/stripe-authorizations/1/relationships/event",
                            "related": "/v1/events/1"
                        }
                    }
                },
                "attributes": {
                    "stripe-publishable-key": "example"
                },
                "type": "stripe-authorization",
                "id": "1",
                "links": {
                    "self": "/v1/stripe-authorizations/1"
                }
            },
            "jsonapi": {
                "version": "1.0"
            },
            "links": {
                "self": "/v1/stripe-authorizations/1"
            }
        }
